<div class="panel panel-default doc-catalog hidden-print" id="doc-catalog" role="complementary">
  <div class="panel-heading"><i class="glyphicon glyphicon-list" aria-hidden="true"></i> 目录</div>
  <div class="panel-body">

    <!-- 渲染目录 -->
    {% if sidebarData is iterable %}
      <ul class="nav doc-sidenav">
        {% for key,listItem in sidebarData %}

          {% if listItem.items is defined and listItem.items is iterable %}
            <li data-list-index="{{ key }}">
            {% if listItem.title is defined %}
              <a href="#sidebar-list-{{ key }}" data-toggle="collapse" class="mder-list-title"
              aria-controls="sidebar-list-{{ key }}"
              aria-expanded="true">
                <strong>{{ listItem.title }}</strong><span class="glyphicon glyphicon-chevron-down" style="float: right;"></span>
              </a>
            {% endif %}
              <ul class="nav collapse in" id="sidebar-list-{{ key }}">
                {% for item in listItem.items %}
                  <li class="{% if _globals.config.urls.route == item.url %}active{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
                {% endfor %}
              </ul>
            </li>

          {% else %}
            <li class="{% if _globals.config.urls.route == listItem.url %}active{% endif %}"><a href="{{ listItem.url }}">{{ listItem.title }}</a></li>
          {% endif %}

        {% endfor %}
        </ul>
    {% else %}
      {{ sidebarData|raw }}
    {% endif %}
  </div>
</div>